def f(x):
    return 3*x**4 - 9*x**2 + x/2
for x in[54,96,83,64,234,158,364]:
    print(f(x))
    